﻿@model ArbabTravelsERP.Models.CandidateModel
@{
    ViewBag.Title = "Create";
    Layout = "~/Views/Shared/_Layout.cshtml";

}

<!DOCTYPE html>


@using (Html.BeginForm("Create", "Candidate", new { ReturnUrl = ViewBag.ReturnUrl }, FormMethod.Post, new { @id = "formControl", @class = "form-horizontal", enctype = "multipart/form-data" }))
{

    @Html.AntiForgeryToken()


            <!-- page content -->
    <div class="right_col" role="main">
        <div class="">
            <div class="page-title">
                <div class="title_left">
                    <h3>Candidate</h3>
                </div>
            </div>
            <div class="clearfix"></div>
            <div class="row">
                <div class="col-md-12 col-sm-12 col-xs-12">
                    <div class="x_panel">
                        <div class="x_title">
                            <h2>Add Candidate Details</h2>
                            <div class="clearfix"></div>
                        </div>


                        <div class="x_content">
                            @if (@TempData["Success"] != null)
                                    {
                                    <div class="alert alert-success alert-dismissable">
                                        <button type="button" class="close" data-dismiss="alert"
                                                aria-hidden="true">
                                            &times;
                                        </button>
                                        @TempData["Success"]
                                    </div>
                                    }

                            @if (@TempData["Error"] != null)
                                    {
                                    <div class="alert alert-dismissable">
                                        <button type="button" class="close" data-dismiss="alert"
                                                aria-hidden="true">
                                            &times;
                                        </button>
                                        @ViewData["Error"]
                                    </div>
                                    }

                            <!-- Tabs -->
                            <br />

                            <!-- Smart Wizard -->
                            <div id="wizard" class="form_wizard wizard_horizontal">
                                <ul class="wizard_steps">
                                    <li>
                                        <a href="#step-1">
                                            <span class="step_no">1</span>
                                            <span class="step_descr">
                                                Step 1<br />
                                                <small>Official Details</small>
                                            </span>
                                        </a>
                                    </li>
                                    <li>
                                        <a href="#step-2">
                                            <span class="step_no">2</span>
                                            <span class="step_descr">
                                                Step 2<br />
                                                <small>Personal Details</small>
                                            </span>
                                        </a>
                                    </li>
                                    <li>
                                        <a href="#step-3">
                                            <span class="step_no">3</span>
                                            <span class="step_descr">
                                                Step 3<br />
                                                <small>Contact Details</small>
                                            </span>
                                        </a>
                                    </li>
                                    <li>
                                        <a href="#step-4">
                                            <span class="step_no">4</span>
                                            <span class="step_descr">
                                                Step 4<br />
                                                <small>Education Details</small>
                                            </span>
                                        </a>
                                    </li>
                                    <li>
                                        <a href="#step-5">
                                            <span class="step_no">5</span>
                                            <span class="step_descr">
                                                Step 5<br />
                                                <small>Work Experience Details</small>
                                            </span>
                                        </a>
                                    </li>
                                    <li>
                                        <a href="#step-6">
                                            <span class="step_no">6</span>
                                            <span class="step_descr">
                                                Step 6<br />
                                                <small>Upload Documents</small>
                                            </span>
                                        </a>
                                    </li>
                                </ul>
                                <div id="step-1">
                                    <h2 class="StepTitle">Step 1 Official Details</h2>
                                    <div id="candidateForm1" data-parsley-validate class="form-horizontal form-label-left">
                                        <div class="form-group">
                                            <label class="control-label col-md-3 col-sm-3" for="requirementNo">Registration No <span class="required">*</span> </label>
                                            <div class="col-md-6 col-sm-6">
                                                @Html.TextBoxFor(model => model.REGISTRATION_NO, new { @id = "REGISTRATION_NO", @class = "form-control  col-md-7 col-xs-12", @autocomplete = "off", @maxlength = "20", @readonly = "readonly" })
                                                @Html.ValidationMessageFor(model => model.REGISTRATION_NO, "", new { @class = "text-danger" })
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label class="control-label col-md-3 col-sm-3">Availing For <span class="required">*</span></label>
                                            <div class="col-md-6 col-sm-6">
                                                @Html.DropDownListFor(model => model.AVAILING_TYPE_ID, ViewData["GetAvailingType"] as SelectList, "Select Availing For", new { @id = "AVAILING_TYPE_ID", @class = "form-control", @autocomplete = "off" })
                                                @Html.ValidationMessageFor(model => model.AVAILING_TYPE_ID, "", new { @class = "text-danger" })
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label class="control-label col-md-3 col-sm-3">Source <span class="required">*</span></label>
                                            <div class="col-md-6 col-sm-6">
                                                @Html.DropDownListFor(model => model.SOURCE_ID, ViewData["GetSource"] as SelectList, "Select Source", new { @id = "SOURCE_ID", @class = "form-control", @autocomplete = "off" })
                                                @Html.ValidationMessageFor(model => model.SOURCE_ID, "", new { @class = "text-danger" })
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label class="control-label col-md-3 col-sm-3">Status <span class="required">*</span></label>
                                            <div class="col-md-6 col-sm-6">
                                                @Html.DropDownListFor(model => model.STATUS_ID, ViewData["GetStatus"] as SelectList, "Select Status", new { @id = "STATUS_ID", @class = "form-control", @autocomplete = "off" })
                                                @Html.ValidationMessageFor(model => model.STATUS_ID, "", new { @class = "text-danger" })
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label class="control-label col-md-3 col-sm-3">Visit No</label>
                                            <div class="col-md-6 col-sm-6">
                                                @Html.TextBoxFor(model => model.VISIT_NUMBER, new { @id = "VISIT_NUMBER", @class = "form-control", @placeholder = "Visit Number", @autocomplete = "off", @maxlength = "20" })
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label for="middle-name" class="control-label col-md-3 col-sm-3">Requirement <span class="required">*</span></label>
                                            <div class="col-md-6 col-sm-6">
                                                @Html.DropDownListFor(model => model.REQUIREMENT_ID, ViewData["GetRequirementType"] as SelectList, "Select Reqirement", new { @id = "REQUIREMENT_ID", @class = "form-control", @autocomplete = "off" })
                                                @Html.ValidationMessageFor(model => model.REQUIREMENT_ID, "", new { @class = "text-danger" })
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label for="middle-name" class="control-label col-md-3 col-sm-3">Visa Number</label>
                                            <div class="col-md-6 col-sm-6">
                                                @Html.DropDownListFor(model => model.VISA_ID, ViewData["GetRequirementType"] as SelectList, "Select Visa Number", new { @id = "VISA_ID", @class = "form-control", @autocomplete = "off" })
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label class="control-label col-md-3 col-sm-3">Login Access </label>
                                            <div class="col-md-6 col-sm-6">
                                                @{
                                    List<SelectListItem> listLoginAccess = new List<SelectListItem>();
                                    listLoginAccess.Add(new SelectListItem
                                    {
                                        Text = "Yes",
                                        Value = "Yes"
                                    });
                                    listLoginAccess.Add(new SelectListItem
                                    {
                                        Text = "No",
                                        Value = "No"
                                    });
                                                }
                                                @Html.DropDownListFor(model => model.LOGIN_ACCESS, listLoginAccess, "--Select Login Access--", new { @id = "LOGIN_ACCESS", @class = "form-control", @autocomplete = "off" })
                                            </div>
                                            @*<div class="col-md-6 col-sm-6 col-xs-12">
                                                    <div class="btn-group" data-toggle="buttons">
                                                        <label class="btn btn-default active">
                                                            <input type="radio" name="loginAccess" id="active" checked="checked">
                                                            Yes
                                                        </label>
                                                        <label class="btn btn-default">
                                                            <input type="radio" name="loginAccess" id="inactive">
                                                            No
                                                        </label>
                                                        @Html.HiddenFor(model => model.LOGIN_ACCESS)
                                                    </div>
                                                </div>*@
                                        </div>
                                        <div class="form-group">
                                            <label class="control-label col-md-3 col-sm-3">Remark</label>
                                            <div class="col-md-6 col-sm-6">
                                                @Html.TextAreaFor(model => model.REMARK, new { @id = "REMARK", @class = "form-control", @placeholder = "Remark", @autocomplete = "off" })
                                            </div>
                                        </div>
                                    </div>

                                </div>
                                <div id="step-2">
                                    <h2 class="StepTitle">Step 2 Personal Details</h2>
                                    <div class="col-md-12" style="margin-top:10px">
                                        <div class="col-md-9">
                                            <div id="candidateForm2" data-parsley-validate class="form-horizontal form-label-left">
                                                <div class="form-group">
                                                    <label for="middle-name" class="control-label col-md-4 col-sm-4">Full Name  <span class="required">*</span></label>
                                                    <div class="col-md-3 col-sm-3">
                                                        @Html.TextBoxFor(model => model.FIRST_NAME, new { @id = "FIRST_NAME", @class = "form-control col-md-7 col-xs-12", @placeholder = "First Name", @autocomplete = "off", @maxlength = "50" })
                                                        @Html.ValidationMessageFor(model => model.FIRST_NAME, "", new { @class = "text-danger" })
                                                    </div>
                                                    <div class="col-md-2 col-sm-2">
                                                        @Html.TextBoxFor(model => model.MIDDLE_NAME, new { @id = "MIDDLE_NAME", @class = "form-control col-md-7 col-xs-12", @placeholder = "Middle Name", @autocomplete = "off", @maxlength = "50" })
                                                    </div>
                                                    <div class="col-md-3 col-sm-3">
                                                        @Html.TextBoxFor(model => model.LAST_NAME, new { @id = "LAST_NAME", @class = "form-control col-md-7 col-xs-12", @placeholder = "Last Name", @autocomplete = "off", @maxlength = "50" })
                                                        @Html.ValidationMessageFor(model => model.LAST_NAME, "", new { @class = "text-danger" })
                                                    </div>


                                                </div>
                                                <div class="form-group">
                                                    <label for="middle-name" class="control-label col-md-4 col-sm-4">Father Name</label>
                                                    <div class="col-md-8 col-sm-8">
                                                        @Html.TextBoxFor(model => model.FATHER_NAME, new { @id = "FATHER_NAME", @class = "form-control col-md-7 col-xs-12", @placeholder = "Father Name", @autocomplete = "off", @maxlength = "80" })
                                                    </div>
                                                </div>
                                                <div class="form-group">
                                                    <label for="middle-name" class="control-label col-md-4 col-sm-4">Mother Name</label>
                                                    <div class="col-md-8 col-sm-8">
                                                        @Html.TextBoxFor(model => model.MOTHER_NAME, new { @id = "MOTHER_NAME", @class = "form-control col-md-7 col-xs-12", @placeholder = "Mother Name", @autocomplete = "off", @maxlength = "80" })
                                                    </div>
                                                </div>
                                                <div class="form-group">
                                                    <label class="control-label col-md-4 col-sm-4">Gender <span class="required">*</span>  </label>
                                                    <div class="col-md-6 col-sm-6">
                                                        @{
                                    List<SelectListItem> listGender = new List<SelectListItem>();
                                    listGender.Add(new SelectListItem
                                    {
                                        Text = "Male",
                                        Value = "Male"
                                    });
                                    listGender.Add(new SelectListItem
                                    {
                                        Text = "Female",
                                        Value = "Female"
                                    });
                                                        }
                                                        @Html.DropDownListFor(model => model.GENDER_CODE, listGender, "--Select Gender--", new { @id = "GENDER_CODE", @class = "form-control", @autocomplete = "off" })
                                                    </div>
                                                    @*<div class="col-md-8 col-sm-8 col-xs-12">
                                                            <div class="btn-group" data-toggle="buttons">
                                                                <label class="btn btn-default active">
                                                                    <input type="radio" name="gender" id="male" value="male" checked="checked">
                                                                    Male
                                                                </label>
                                                                <label class="btn btn-default">
                                                                    <input type="radio" name="gender" id="female" value="female">
                                                                    Female
                                                                </label>
                                                                @Html.HiddenFor(model => model.GENDER_CODE)
                                                            </div>
                                                        </div>*@
                                                </div>
                                                <div class="form-group">
                                                    <label class="control-label col-md-4 col-sm-4" for="contactPerson">Date of Birth <span class="required">*</span> </label>
                                                    <div class="col-md-8 col-sm-8">
                                                        @Html.TextBoxFor(model => model.DATE_OF_BIRTH, new { @id = "DATE_OF_BIRTH", @class = "form-control", @placeholder = "Date of Birth", @autocomplete = "off", @maxlength = "20" })
                                                        @Html.ValidationMessageFor(model => model.DATE_OF_BIRTH, "", new { @class = "text-danger" })
                                                        <span id="textBoxName"></span>
                                                    </div>
                                                </div>
                                                <div class="form-group">
                                                    <label class="control-label col-md-4 col-sm-4">Place of Birth </label>
                                                    <div class="col-md-8 col-sm-8">
                                                        @Html.TextBoxFor(model => model.PLACE_OF_BIRTH, new { @id = "PLACE_OF_BIRTH", @class = "form-control", @placeholder = "Place of Birth", @autocomplete = "off", @maxlength = "50" })

                                                    </div>
                                                </div>
                                                <div class="form-group">
                                                    <label class="control-label col-md-4 col-sm-4">Martial Status</label>
                                                    <div class="col-md-8 col-sm-8">
                                                        @Html.DropDownListFor(model => model.MARITAL_STATUS_ID, ViewData["GetMaritalStatus"] as SelectList, "Select Marital Status", new { @id = "MARITAL_STATUS_ID", @class = "form-control", @autocomplete = "off" })

                                                    </div>
                                                </div>
                                                <div class="form-group">
                                                    <label class="control-label col-md-4 col-sm-4">Nationality <span class="required">*</span></label>
                                                    <div class="col-md-8 col-sm-8">
                                                        @Html.DropDownListFor(model => model.NATIONALITY_ID, ViewData["GetNationality"] as SelectList, "Select Nationality", new { @id = "NATIONALITY_ID", @class = "form-control", @autocomplete = "off" })
                                                        @Html.ValidationMessageFor(model => model.NATIONALITY_ID, "", new { @class = "text-danger" })
                                                    </div>
                                                </div>
                                                <div class="form-group">
                                                    <label class="control-label col-md-4 col-sm-4">Current Location <span class="required">*</span></label>
                                                    <div class="col-md-8 col-sm-8">
                                                        @Html.DropDownListFor(model => model.CURRENT_LOCATION, ViewData["GetLocation"] as SelectList, "Select Current Location", new { @id = "CURRENT_LOCATION", @class = "form-control", @autocomplete = "off" })
                                                        @Html.ValidationMessageFor(model => model.CURRENT_LOCATION, "", new { @class = "text-danger" })
                                                    </div>
                                                </div>
                                                <div class="form-group">
                                                    <label class="control-label col-md-4 col-sm-4">Religion<span class="required">*</span></label>
                                                    <div class="col-md-8 col-sm-8">
                                                        @Html.DropDownListFor(model => model.RELIGION_ID, ViewData["GetReligion"] as SelectList, "Select Religion", new { @id = "RELIGION_ID", @class = "form-control", @autocomplete = "off" })
                                                        @Html.ValidationMessageFor(model => model.RELIGION_ID, "", new { @class = "text-danger" })
                                                    </div>
                                                </div>

                                                <div class="form-group">
                                                    <label for="middle-name" class="control-label col-md-4 col-sm-4">Languages</label>
                                                    <div class="col-md-7 col-sm-7">
                                                        @Html.DropDownListFor(model => model.LANGUAGE_ID, ViewData["GetLanguage"] as SelectList, "Select Language", new { @id = "LANGUAGE_ID", @class = "form-control", @autocomplete = "off" })
                                                    </div>
                                                    <div class="col-xs-1">
                                                        <button type="button" class="addAddress addButton" id="SaveLanguage"><i class="fa fa-plus"></i></button>
                                                    </div>
                                                </div>

                                                <div class="form-group">
                                                    <label class="control-label col-md-4 col-sm-4">Read</label>
                                                    <div class="col-md-8 col-sm-8">
                                                        @Html.CheckBoxFor(model => model.IS_READ, new { @id = "IS_READ", @autocomplete = "off" })
                                                    </div>
                                                </div>
                                                <div class="form-group">
                                                    <label class="control-label col-md-4 col-sm-4">Write</label>
                                                    <div class="col-md-8 col-sm-8">
                                                        @Html.CheckBoxFor(model => model.IS_WRITE, new { @id = "IS_WRITE", @autocomplete = "off" })
                                                    </div>
                                                </div>
                                                <div class="form-group">
                                                    <label class="control-label col-md-4 col-sm-4">Speak</label>
                                                    <div class="col-md-8 col-sm-8">
                                                        @Html.CheckBoxFor(model => model.IS_SPEAK, new { @id = "IS_SPEAK", @autocomplete = "off" })
                                                    </div>
                                                </div>

                                                <table class="table  table-bordered table-responsive table-striped" id="tbllanguage"></table>
                                                <hr />
                                                <h4>Passport Details</h4>
                                                <div class="form-group">
                                                    <label class="control-label col-md-4 col-sm-4">Passport No</label>
                                                    <div class="col-md-8 col-sm-8">
                                                        @Html.TextBoxFor(model => model.PASSPORT_NO, new { @id = "PASSPORT_NO", @class = "form-control", @placeholder = "Passport No", @autocomplete = "off", @maxlength = "20" })
                                                    </div>
                                                </div>
                                                <div class="form-group">
                                                    <label class="control-label col-md-4 col-sm-4">Place Of Issue</label>
                                                    <div class="col-md-8 col-sm-8">
                                                        @Html.TextBoxFor(model => model.PLACE_OF_ISSUE, new { @id = "PLACE_OF_ISSUE", @class = "form-control", @placeholder = "Place of Issue", @autocomplete = "off", @maxlength = "20" })
                                                    </div>
                                                </div>

                                                <div class="form-group input-daterange">
                                                    <label class="control-label col-md-4 col-sm-4" for="contactPerson">Date of Issue </label>
                                                    <div class="col-md-8 col-sm-8">
                                                        @Html.TextBoxFor(model => model.DATE_OF_ISSUE, new { @id = "DATE_OF_ISSUE", @class = "form-control", @placeholder = "Date of Issue", @autocomplete = "off", @maxlength = "20" })
                                                    </div>
                                                </div>
                                                <div class="form-group input-daterange">
                                                    <label class="control-label col-md-4 col-sm-4" for="contactPerson">Date Of Expiry</label>
                                                    <div class="col-md-8 col-sm-8">
                                                        @Html.TextBoxFor(model => model.EXPIRY_DATE, new { @id = "EXPIRY_DATE", @class = "form-control", @placeholder = "Expiry Date", @autocomplete = "off", @maxlength = "20" })
                                                    </div>
                                                </div>

                                                <div class="form-group">
                                                    <label class="control-label col-md-4 col-sm-4">Emigration Clearance </label>
                                                    <div class="col-md-8 col-sm-8 col-xs-12">
                                                        @{
                                    List<SelectListItem> listEmigration = new List<SelectListItem>();
                                    listEmigration.Add(new SelectListItem
                                    {
                                        Text = "Required",
                                        Value = "Required"
                                    });
                                    listEmigration.Add(new SelectListItem
                                    {
                                        Text = "Not Required",
                                        Value = "NotRequired"
                                    });
                                                        }
                                                        @Html.DropDownListFor(model => model.IS_EMIGRATION, listEmigration, "Select Emigration", new { @id = "IS_EMIGRATION", @class = "form-control", @autocomplete = "off" })
                                                    </div>
                                                    @*<div class="col-md-8 col-sm-8 col-xs-12">
                                                            <div class="btn-group" data-toggle="buttons">
                                                                <label class="btn btn-default active">
                                                                    <input type="radio" name="emigration" id="required" value="required" checked="checked">
                                                                    Required
                                                                </label>
                                                                <label class="btn btn-default">
                                                                    <input type="radio" name="emigration" id="notRequired" value="notRequired">
                                                                    Not Required
                                                                </label>
                                                                @Html.HiddenFor(model => model.IS_EMIGRATION)
                                                            </div>
                                                        </div>*@
                                                </div>

                                                <hr />
                                                <h4>Driving License Details</h4>
                                                <div class="form-group">
                                                    <label class="control-label col-md-4 col-sm-4">Driving License No</label>
                                                    <div class="col-md-8 col-sm-8">
                                                        @Html.TextBoxFor(model => model.DRIVING_LICENCE_NUMBER, new { @id = "DRIVING_LICENCE_NUMBER", @class = "form-control", @placeholder = "Driving License No.", @autocomplete = "off", @maxlength = "20" })

                                                    </div>
                                                </div>
                                                <div class="form-group">
                                                    <label class="control-label col-md-4 col-sm-4">Place Of Issue</label>
                                                    <div class="col-md-8 col-sm-8">
                                                        @Html.TextBoxFor(model => model.DRIVING_PLACE_OF_ISSUE, new { @id = "DRIVING_PLACE_OF_ISSUE", @class = "form-control", @placeholder = "Place of Issue", @autocomplete = "off", @maxlength = "20" })

                                                    </div>
                                                </div>
                                                <div class="form-group">
                                                    <label class="control-label col-md-4 col-sm-4" for="contactperson">Date Of Issue</label>
                                                    <div class="col-md-8 col-sm-8">
                                                        @Html.TextBoxFor(model => model.DRIVING_DATE_OF_ISSUE, new { @id = "DRIVING_DATE_OF_ISSUE", @class = "form-control", @placeholder = "Date of Issue", @autocomplete = "off", @maxlength = "20" })

                                                    </div>
                                                </div>
                                                <div class="form-group">
                                                    <label class="control-label col-md-4 col-sm-4" for="contactperson">Date Of Expiry</label>
                                                    <div class="col-md-6 col-sm-6">
                                                        @Html.TextBoxFor(model => model.DRIVING_EXPIRY_DATE, new { @id = "DRIVING_EXPIRY_DATE", @class = "date-picker form-control", @placeholder = "Expiry Date", @autocomplete = "off", @maxlength = "20" })

                                                    </div>
                                                </div>
                                                <div class="form-group">
                                                    <label class="control-label col-md-4 col-sm-4">Vehicle Type</label>
                                                    <div class="col-md-8 col-sm-8 col-xs-12">

                                                        @Html.DropDownListFor(model => model.VEHICLE_TYPE_ID, ViewData["GetVehicleType"] as SelectList, "--Select Vehicle Type--", new { @id = "VEHICLE_TYPE", @class = "form-control", @autocomplete = "off" })
                                                    </div>
                                                    @*<div class="col-md-8 col-sm-8 col-xs-12">
                                                            <div class="btn-group" data-toggle="buttons">
                                                                <label class="btn btn-default active">
                                                                    <input type="radio" name="vehicle" id="light" value="light" checked="checked">
                                                                    Light
                                                                </label>
                                                                <label class="btn btn-default">
                                                                    <input type="radio" name="vehicle" id="Heavy" value="Heavy">
                                                                    Heavy
                                                                </label>
                                                                @Html.HiddenFor(model => model.VEHICLE_TYPE)
                                                            </div>
                                                        </div>*@
                                                </div>
                                                <div class="form-group">
                                                    <label class="control-label col-md-4 col-sm-4">Remark</label>
                                                    <div class="col-md-8 col-sm-8">
                                                        @Html.TextAreaFor(model => model.DRIVING_REMARK, new { @id = "DRIVING_REMARK", @class = " form-control", @placeholder = "Remark", @autocomplete = "off" })

                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="col-md-3">

                                            <div class="fileinput fileinput-new" data-provides="fileinput">
                                                <div class="fileinput-preview thumbnail" data-trigger="fileinput" style="width: 200px; height: 150px;"></div>
                                                <div>
                                                    <span class="btn btn-default btn-file"><span class="fileinput-new">Select image</span><span class="fileinput-exists">Change</span><input type="file" name="..." id="SaveImage"></span>
                                                    <a href="#" class="btn btn-default fileinput-exists" data-dismiss="fileinput">Remove</a>
                                                    @Html.HiddenFor(model => model.USER_IMAGE_PATH)
                                                </div>

                                            </div>
                                        </div>
                                    </div>

                                </div>

                                <div id="step-3">
                                    <h2 class="StepTitle">Step 3 Contact Details</h2>
                                    <div id="candidateForm3" class="form-horizontal form-label-left">
                                        <div class="groupAddress">
                                            <div class="form-group">
                                                <label class="control-label col-md-3 col-sm-3" for="contactPerson">
                                                    Address <span class="required">*</span>
                                                </label>
                                                <div class="col-md-2 col-sm-2">
                                                    @Html.DropDownListFor(model => model.ADDRESS_TYPE_ID, ViewData["GetAddressType"] as SelectList, "Select Address Type", new { @id = "ADDRESS_TYPE_ID", @class = "form-control", @autocomplete = "off" })

                                                </div>
                                                <div class="col-md-4 col-sm-4">
                                                    @Html.TextBoxFor(model => model.ADDRESS, new { @id = "ADDRESS", @class = " form-control", @placeholder = "Address", @autocomplete = "off" })
                                                </div>
                                                <div class="">
                                                    <button type="button" class="addAddress addButton" id="SaveAddress"><i class="fa fa-plus"></i></button>
                                                </div>
                                            </div>
                                            <div class="form-group">
                                                <div class="col-xs-offset-3 col-md-3 col-sm-3">
                                                    @Html.DropDownListFor(model => model.COUNTRY_CODE, ViewData["GetCountryStateCity"] as SelectList, "Select Country", new { @id = "COUNTRY_CODE", @class = "form-control", @autocomplete = "off" })

                                                </div>
                                                <div class="col-md-3 col-sm-3">
                                                    @Html.DropDownListFor(model => model.STATE_CODE, ViewData["GetCountryStateCity"] as SelectList, "Select State", new { @id = "STATE_CODE", @class = "form-control", @autocomplete = "off" })

                                                </div>
                                            </div>
                                            <div class="form-group">
                                                <div class="col-xs-offset-3 col-md-3 col-sm-3">
                                                    @Html.DropDownListFor(model => model.CITY_CODE, ViewData["GetCountryStateCity"] as SelectList, "Select City", new { @id = "CITY_CODE", @class = "form-control", @autocomplete = "off" })

                                                </div>
                                                <div class="col-md-3 col-sm-3">
                                                    @Html.TextBoxFor(model => model.VILLAGE, new { @id = "VILLAGE", @class = "form-control col-md-7 col-xs-12", @placeholder = "Village", @autocomplete = "off", @maxlength = "20" })

                                                </div>
                                            </div>

                                            <div class="form-group">
                                                <label for="middle-name" class="control-label col-md-3 col-sm-3">Pin Code</label>
                                                <div class="col-md-6 col-sm-6">
                                                    @Html.TextBoxFor(model => model.PIN_CODE, new { @id = "PIN_CODE", @class = " form-control", @placeholder = "Pin Code", @autocomplete = "off", @maxlength = "6", @onkeypress = "return isNumberKey(event)" })
                                                </div>
                                            </div>

                                            <table class="table  table-bordered table-responsive table-striped" id="tblchild"></table>
                                        </div>


                                        <div class="form-group">
                                            <label for="middle-name" class="control-label col-md-3 col-sm-3">Email Address</label>
                                            <div class="col-md-6 col-sm-6">
                                                @Html.TextBoxFor(model => model.EMAIL_ID, new { @id = "EMAIL_ID", @class = " form-control col-md-7 col-xs-12", @placeholder = "Email ID", @autocomplete = "off" })

                                                <span class="fa fa-envelope-o form-control-feedback right" aria-hidden="true"></span>
                                            </div>
                                            <div class="col-xs-1">
                                                <button type="button" class="addButton addEmailButton" id="SaveEmail"><i class="fa fa-plus"></i></button>
                                            </div>
                                        </div>
                                        <table class="table  table-bordered table-responsive table-striped form-group-sm" id="tblemail"></table>

                                        <div class="form-group">
                                            <label for="middle-name" class="control-label col-md-3 col-sm-3">Phone Number <span class="required">*</span></label>
                                            <div class="col-md-2 col-sm-2">
                                                @Html.DropDownListFor(model => model.PHONE_TYPE_ID, ViewData["GetAddressType"] as SelectList, new { @id = "PHONE_TYPE_ID", @class = "form-control", @autocomplete = "off" })

                                            </div>
                                            <div class="col-md-4 col-sm-4">
                                                @Html.TextBoxFor(model => model.PHONE_NO, new { @id = "PHONE_NO", @class = " form-control col-md-7 col-xs-12", @placeholder = "Phone No", @autocomplete = "off", @maxlength = "11", @onkeypress = "return isNumberKey(event)" })
                                                <span class="fa fa-phone form-control-feedback right" aria-hidden="true"></span>
                                            </div>
                                            <div class="col-xs-1">
                                                <button type="button" class="addButton addPhoneButton" id="SavePhone"><i class="fa fa-plus"></i></button>
                                            </div>
                                        </div>
                                        <table class="table  table-bordered table-responsive table-striped form-group-sm" id="tblphone"></table>

                                        <div class="form-group">
                                            <label for="middle-name" class="control-label col-md-3 col-sm-3">Website</label>
                                            <div class="col-md-6 col-sm-6">
                                                @Html.TextBoxFor(model => model.WEBSITE, new { @id = "WEBSITE", @class = " form-control col-md-7 col-xs-12", @placeholder = "Website", @autocomplete = "off" })

                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label for="middle-name" class="control-label col-md-3 col-sm-3">Skype</label>
                                            <div class="col-md-6 col-sm-6">
                                                @Html.TextBoxFor(model => model.SKYPE, new { @id = "SKYPE", @class = " form-control col-md-7 col-xs-12", @placeholder = "Skype", @autocomplete = "off" })
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label class="control-label col-md-3 col-sm-3">Remark</label>
                                            <div class="col-md-6 col-sm-6">
                                                @Html.TextAreaFor(model => model.CONTACT_REMARK, new { @id = "CONTACT_REMARK", @class = " form-control col-md-7 col-xs-12", @placeholder = "Remark", @autocomplete = "off" })
                                            </div>
                                        </div>
                                    </div>
                                </div>

                                <div id="step-4">
                                    <h2 class="StepTitle">Step 4 Educational Details</h2>
                                    <div id="candidateForm4" data-parsley-validate class="form-horizontal form-label-left">
                                        <div class="groupAddress">
                                            <div class="form-group">
                                                <label class="control-label col-md-3 col-sm-3" for="Education">Education</label>
                                                <div class="col-md-6 col-sm-6">
                                                    @Html.DropDownListFor(model => model.EDUCATION_TYPE_ID, ViewData["GetEducation"] as SelectList, "Select Education", new { @id = "EDUCATION_TYPE_ID", @class = "form-control", @autocomplete = "off" })
                                                </div>
                                                <div class="">
                                                    <button type="button" class="addAddress addButton" id="SaveEducation"><i class="fa fa-plus"></i></button>
                                                </div>
                                            </div>
                                            <div class="form-group">
                                                <label class="control-label col-md-3 col-sm-3" for="Specialization">Specialization</label>
                                                <div class="col-md-6 col-sm-6">
                                                    @Html.DropDownListFor(model => model.SPECIALIZATION_TYPE_ID, ViewData["GetSpecialization"] as SelectList, "Select Specialization", new { @id = "SPECIALIZATION_TYPE_ID", @class = "form-control", @autocomplete = "off" })
                                                </div>
                                            </div>
                                            <div class="form-group">
                                                <label class="control-label col-md-3 col-sm-3" for="University">University</label>
                                                <div class="col-md-6 col-sm-6">
                                                    @Html.DropDownListFor(model => model.UNIVERSITY_ID, ViewData["GetUniversity"] as SelectList, "Select University", new { @id = "UNIVERSITY_ID", @class = "form-control", @autocomplete = "off" })
                                                </div>
                                            </div>

                                            <div class="form-group">
                                                <label class="control-label col-md-3 col-sm-3" for="Passing">Year of Passing</label>
                                                <div class="col-md-6 col-sm-6">
                                                    @Html.TextBoxFor(model => model.UNIVERSITY_YEAR_OF_PASSING, new { @id = "UNIVERSITY_YEAR_OF_PASSING", @class = " form-control col-md-7 col-xs-12", @placeholder = "Year of Passing", @autocomplete = "off", @maxlength = "4", @onkeypress = "return isNumberKey(event)" })
                                                </div>
                                            </div>
                                            <table class="table  table-bordered table-responsive table-striped" id="tbleducation"></table>
                                        </div>

                                        <div class="groupCertification">
                                            <div class="form-group">
                                                <label class="control-label col-md-3 col-sm-3" for="Certification">Certification</label>
                                                <div class="col-md-6 col-sm-6">
                                                    @Html.TextBoxFor(model => model.CERTIFICATION, new { @id = "CERTIFICATION", @class = " form-control col-md-10 auto-custom", @style = "float: left;", @placeholder = "Certification", @autocomplete = "off" })

                                                    <div class="" id="autocomplete-container" style="position: relative; float: left; width: 400px;"></div>
                                                </div>
                                                <div class="">
                                                    <button type="button" class="addCertification addButton" id="SaveCertification"><i class="fa fa-plus"></i></button>
                                                </div>
                                            </div>
                                            <div class="form-group">
                                                <label class="control-label col-md-3 col-sm-3" for="Level">Level</label>
                                                <div class="col-md-6 col-sm-6">
                                                    @Html.TextBoxFor(model => model.CERTIFICATION_LEVEL, new { @id = "CERTIFICATION_LEVEL", @class = " form-control col-md-7 col-xs-12", @style = "float: left;", @placeholder = "CERTIFICATION_LEVEL", @autocomplete = "off" })

                                                </div>
                                            </div>
                                            <div class="form-group">
                                                <label class="control-label col-md-3 col-sm-3" for="Insititue">Insititue</label>
                                                <div class="col-md-6 col-sm-6">
                                                    @Html.TextBoxFor(model => model.INSTITUTE_NAME, new { @id = "INSTITUTE_NAME", @class = " form-control col-md-7 col-xs-12", @style = "float: left;", @placeholder = "Institute Name", @autocomplete = "off" })

                                                </div>
                                            </div>

                                            <div class="form-group">
                                                <label class="control-label col-md-3 col-sm-3" for="Passing">Year of Passing</label>
                                                <div class="col-md-6 col-sm-6">
                                                    @Html.TextBoxFor(model => model.INSTITUE_YEAR_OF_PASSIN, new { @id = "INSTITUE_YEAR_OF_PASSIN", @class = "date-picker form-control col-md-7 col-xs-12", @style = "float: left;", @placeholder = "Year of Passing", @autocomplete = "off", @maxlength = "4", @onkeypress = "return isNumberKey(event)" })

                                                </div>
                                            </div>
                                            <table class="table  table-bordered table-responsive table-striped" id="tblcertification"></table>
                                        </div>


                                        <div class="form-group">
                                            <label class="control-label col-md-3 col-sm-3">Remark</label>
                                            <div class="col-md-6 col-sm-6">
                                                @Html.TextBoxFor(model => model.EDUCATIONAL_REMARK, new { @id = "EDUCATIONAL_REMARK", @class = "date-picker form-control col-md-7 col-xs-12", @placeholder = "Remark", @autocomplete = "off" })

                                            </div>
                                        </div>
                                    </div>
                                </div>
                                <div id="step-5">
                                    <h2 class="StepTitle">Step 5 Work Experience Details</h2>
                                    <div id="candidateForm5" data-parsley-validate class="form-horizontal form-label-left">
                                        <div class="form-group">
                                            <label class="control-label col-md-3 col-sm-3">Career Status</label>
                                            <div class="col-md-6 col-sm-6 col-xs-12">
                                                <div class="btn-group" data-toggle="buttons" id="isExp">
                                                    <label class="btn btn-default active">

                                                        <input type="radio" name="careerstatus" id="Experience" value="Experience" checked="checked">
                                                        Experienced
                                                    </label>
                                                    <label class="btn btn-default">
                                                        <input type="radio" name="careerstatus" id="Fresher" value="Fresher">
                                                        Fresher
                                                    </label>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="groupCompany career">
                                            <div class="form-group">
                                                <label class="control-label col-md-3 col-sm-3">Company Name</label>
                                                <div class="col-md-6 col-sm-6">
                                                    @Html.DropDownListFor(model => model.USER_COMPANY_NAME, ViewData["GetCompany"] as SelectList, "Select Company", new { @id = "USER_COMPANY_NAME", @class = "form-control", @autocomplete = "off" })

                                                </div>
                                                <div class="col-xs-1">
                                                    <button type="button" class="addButton addCompany" id="SaveWork"><i class="fa fa-plus"></i></button>
                                                </div>
                                            </div>
                                            <div class="form-group">
                                                <label class="control-label col-md-3 col-sm-3">Currently Working</label>
                                                <div class="col-md-6 col-sm-6 col-xs-12">
                                                    <div class="btn-group" data-toggle="buttons">
                                                        <label class="btn btn-default active">
                                                            <input type="radio" name="currentlyworking" id="WorkNo" value="No" checked="checked">
                                                            No
                                                        </label>
                                                        <label class="btn btn-default">
                                                            <input type="radio" name="currentlyworking" id="WorkYes" value="Yes">
                                                            Yes
                                                        </label>
                                                    </div>
                                                </div>
                                            </div>
                                            <div class="form-group">
                                                <label class="control-label col-md-3 col-sm-3">Designation</label>
                                                <div class="col-md-6 col-sm-6">
                                                    @Html.DropDownListFor(model => model.DESIGNATION_ID, ViewData["GetDesignation"] as SelectList, "Select Designation", new { @id = "DESIGNATION_ID", @class = "form-control", @autocomplete = "off" })

                                                </div>
                                            </div>
                                            <div class="form-group">
                                                <label class="control-label col-md-3 col-sm-3">Industry</label>
                                                <div class="col-md-6 col-sm-6">
                                                    @Html.DropDownListFor(model => model.INDUSTRY_ID, ViewData["GetIndustry"] as SelectList, "Select Industry", new { @id = "INDUSTRY_ID", @class = "form-control", @autocomplete = "off" })
                                                </div>
                                            </div>
                                            <div class="form-group">
                                                <label class="control-label col-md-3 col-sm-3" for="contactperson">Work Period</label>
                                                <div class="col-md-3 col-sm-3 datepicker" id="datepicker" data-date-format="dd/MM/yyyy">
                                                    @Html.TextBoxFor(model => model.WORK_PERIOD_FROM, new { @id = "WORK_PERIOD_FROM", @class = "date-picker form-control col-md-7 col-xs-12", @placeholder = "Period From", @autocomplete = "off" })

                                                    <span class="fa fa-calendar-o form-control-feedback right" aria-hidden="true"></span>
                                                </div>
                                                <div class="col-md-3 col-sm-3 datepicker" id="datepicker" data-date-format="dd/MM/yyyy">
                                                    @Html.TextBoxFor(model => model.WORK_PERIOD_TO, new { @id = "WORK_PERIOD_TO", @class = "date-picker form-control col-md-7 col-xs-12", @placeholder = "Period To", @autocomplete = "off" })

                                                    <span class="fa fa-calendar-o form-control-feedback right" aria-hidden="true"></span>
                                                </div>
                                            </div>
                                            <div class="form-group">
                                                <label class="control-label col-md-3 col-sm-3">Country</label>
                                                <div class="col-md-6 col-sm-6">
                                                    @Html.DropDownListFor(model => model.WORK_EXP_COUNTRY_CODE, ViewData["GetCountryStateCity"] as SelectList, "Select Country", new { @id = "WORK_EXP_COUNTRY_CODE", @class = "form-control", @autocomplete = "off" })

                                                </div>

                                            </div>

                                            <div class="form-group">
                                                <label class="control-label col-md-3 col-sm-3">State</label>
                                                <div class="col-md-6 col-sm-6">
                                                    @Html.DropDownListFor(model => model.WORK_EXP_STATE_CODE, ViewData["GetCountryStateCity"] as SelectList, "Select State", new { @id = "WORK_EXP_STATE_CODE", @class = "form-control", @autocomplete = "off" })

                                                </div>
                                            </div>
                                            <div class="form-group">
                                                <label class="control-label col-md-3 col-sm-3">City</label>
                                                <div class="col-md-6 col-sm-6">
                                                    @Html.DropDownListFor(model => model.WORK_EXP_CITY_CODE, ViewData["GetCountryStateCity"] as SelectList, "Select City", new { @id = "WORK_EXP_CITY_CODE", @class = "form-control", @autocomplete = "off" })

                                                </div>
                                            </div>
                                            <table class="table  table-bordered table-responsive table-striped form-group-sm" id="tblwork"></table>
                                        </div>


                                        <div class="form-group career ">
                                            <label class="control-label col-md-3 col-sm-3">Total Work Experience</label>
                                            <div class="col-md-6 col-sm-6">
                                                @Html.TextBoxFor(model => model.TOTAL_WORK_EXPERIENCE, new { @id = "TOTAL_WORK_EXPERIENCE", @class = "form-control", @placeholder = "Total Work Experience", @autocomplete = "off" })
                                            </div>
                                        </div>


                                        <div class="form-group career">
                                            <label class="control-label col-md-3 col-sm-3">Total Gulf Experience</label>
                                            <div class="col-md-6 col-sm-6">
                                                @Html.TextBoxFor(model => model.TOTAL_GULF_EXPERIENCE, new { @id = "TOTAL_GULF_EXPERIENCE", @class = "form-control", @placeholder = "Total Gulf Experiemce", @autocomplete = "off" })
                                            </div>
                                        </div>

                                        <div class="form-group">
                                            <label class="control-label col-md-3 col-sm-3">Skills</label>
                                            <div class="col-md-6 col-sm-6">
                                                @Html.TextBoxFor(model => model.SKILLS, new { @id = "SKILLS", @class = "form-control", @placeholder = "Skills", @autocomplete = "off" })

                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label class="control-label col-md-3 col-sm-3">Remark</label>
                                            <div class="col-md-6 col-sm-6">
                                                @Html.TextAreaFor(model => model.EXP_REMARK, new { @id = "EXP_REMARK", @class = "form-control", @placeholder = "Remark", @autocomplete = "off" })

                                            </div>
                                        </div>

                                    </div>
                                </div>
                                <div id="step-6">
                                    <h2 class="StepTitle">Step 6 Upload Documents</h2>
                                    <div id="candidateForm6" data-parsley-validate class="form-horizontal form-label-left">
                                        <div class="groupDocuments">
                                            <div class="form-group">
                                                <label class="control-label col-md-4 col-sm-4">Document Type </label>
                                                <div class="col-md-6 col-sm-6">
                                                    @Html.TextBoxFor(model => model.DOCUMENT_TYPE_ID, new { @id = "DOCUMENT_TYPE_ID", @class = "form-control col-md-10 document-custom", @style = "float: left;", @placeholder = "Document Type", @autocomplete = "off" })
                                                    <div class="" id="document-container" style="position: relative; float: left; width: 400px;"></div>
                                                </div>

                                                <div class="">
                                                    <button type="button" class="addDocuments addButton" id="SaveDoc"><i class="fa fa-plus"></i></button>
                                                </div>
                                            </div>

                                            <div class="form-group">
                                                <label class="control-label col-md-4 col-sm-4">Attach Document</label>
                                                <div class="col-md-6 col-sm-6">
                                                    <div class="fileinput fileinput-new" data-provides="fileinput">
                                                        <span class="btn btn-default btn-file" style="margin-left:0px;"><span class="fileinput-new">Select file</span><span class="fileinput-exists">Change</span><input type="file" name="..." id="DOCUMENT_PATH"></span>
                                                        <span class="fileinput-filename"></span>
                                                        <a href="#" class="close fileinput-exists" data-dismiss="fileinput" style="float: none">&times;</a>
                                                    </div>

                                                </div>
                                            </div>
                                            <table class="table  table-bordered table-responsive table-striped form-group-sm" id="tbldoc"></table>
                                        </div>

                                    </div>
                                </div>
                            </div>

                            <!-- End SmartWizard Content -->
                            @Html.ValidationSummary(false, "", new { @class = "text-danger" })


                        </div>
                    </div>
                </div>
            </div>
        </div>


        <!-- footer content -->
        <footer>
            <div class="">
                <!--p class="pull-right">Gentelella Alela! a Bootstrap 3 template by <a>Kimlabs</a>. |
                                      <span class="lead"> <i class="fa fa-paw"></i> Gentelella Alela!</span>
                                  </p-->
            </div>
            <div class="clearfix"></div>
        </footer>
        <!-- /footer content -->

    </div>
            <!-- /page content -->

}
<div id="custom_notifications" class="custom-notifications dsp_none">
    <ul class="list-unstyled notifications clearfix" data-tabbed_notifications="notif-group"></ul>
    <div class="clearfix"></div>
    <div id="notif-group" class="tabbed_notifications"></div>
</div>
<script type="text/javascript" src="~/js/bootstrapValidator.js"></script>
<!-- bootstrap progress js -->
<script src="~/js/progressbar/bootstrap-progressbar.min.js"></script>
<script src="~/js/nicescroll/jquery.nicescroll.min.js"></script>
<!-- icheck -->
<script src="~/js/icheck/icheck.min.js"></script>
<!-- range slider -->
<script src="~/js/ion_range/ion.rangeSlider.min.js"></script>
<!-- input mask -->
<script src="~/js/input_mask/jquery.inputmask.js"></script>
<script src="~/js/custom.js"></script>
<!-- form wizard -->
<script type="text/javascript" src="~/js/wizard/jquery.smartWizard.js"></script>
<!-- select2 -->
<script src="~/js/select/select2.full.js"></script>
<!-- tags -->
<script src="~/js/tags/jquery.tagsinput.min.js"></script>
<!-- Multiselect -->
<script type="text/javascript" src="~/js/prettify.js"></script>
<script type="text/javascript" src="~/js/bootstrap-multiselect.js"></script>
<!-- Datatables -->
<script src="~/js/datatables/js/jquery.dataTables.js"></script>
<script src="~/js/datatables/tools/js/dataTables.tableTools.js"></script>
<!--file input-->
<script src="~/js/jasny-bootstrap/jasny-bootstrap.min.js"></script>
<script src="~/Scripts/bootstrap-datepicker.js"></script>
<link href="~/Content/bootstrap-datepicker.css" rel="stylesheet" />
<script src="~/js/mask.js"></script>

<script type="text/javascript">
    $(document).ready(function () {
        $("#SaveImage").change(function (e) {
            debugger;
            var imagepath = $("#SaveImage").val();
            $("#USER_IMAGE_PATH").val(imagepath);
        });
    });
</script>
<script type="text/javascript">
    $(document).ready(function () {
        var regno = '@ViewData["RegNo"]';
        $("#REGISTRATION_NO").val(regno);

    });
</script>

<script type="text/jscript">
    //get file size
    function GetFileSize(fileid) {
        try {
            var fileSize = 0;
            //for FF, Safari, Opeara and Others
            fileSize = $("#" + fileid)[0].files[0].size //size in kb
            fileSize = fileSize / 1048576; //size in mb
            return fileSize;
        }
        catch (e) {
            alert("Error is :" + e);
        }
    }

    //get file path from client system
    function getNameFromPath(strFilepath) {
        var objRE = new RegExp(/([^\/\\]+)$/);
        var strName = objRE.exec(strFilepath);

        if (strName == null) {
            return null;
        }
        else {
            return strName[0];
        }
    }

    function checkfile() {
        var file = getNameFromPath($("#DOCUMENT_PATH").val());
        if (file != null) {
            var extension = file.substr((file.lastIndexOf('.') + 1));
            // alert(extension);
            switch (extension) {
                case 'doc':
                    //case 'xlsx':
                    flag = true;
                    break;
                default:
                    flag = false;
            }
        }
        if (flag == false) {
            $("#DOCUMENT_PATH").val('');
            alert("You can upload only doc extension file");
            return false;
        }
        else {
            if (file != null) {
                var maxfilesize = 3;

                var size = GetFileSize('DOCUMENT_PATH');
                if (size > maxfilesize) {
                    alert("You can upload file up to " + maxfilesize + " MB");
                    return false;
                }
            }
        }
    }

    $(function () {
        $("#DOCUMENT_PATH").change(function () {
            checkfile();
        });
    });
</script>
<script type="text/javascript">
    $(document).ready(function () {
        $("#SaveDoc").click(function (e) {
            if ($('#DOCUMENT_PATH').val() == "") {
                alert("Please upload file");
                return false;
            }
            else if ($('#DOCUMENT_TYPE_ID').val() == "") {
                alert("Please enter Document Type");
                $('#DOCUMENT_TYPE_ID').focus();
                return false;
            }



            $.ajax({
                type: 'POST',
                url: '@Url.Action("UploadFile")', // we are calling json method
                dataType: 'json',
                data: { docpath: $("#DOCUMENT_PATH").val(), doctype: $("#DOCUMENT_TYPE_ID").val(), regno: $("#REGISTRATION_NO").val() },
                success: function (data) {
                    data = $.parseJSON(data);
                    var row = "";
                    row += "<tr><th>ID</th><th>Document Type</th><th>Document</th><th></th></tr>"
                    $.each(data, function (index, item) {
                        row += "<tr><td>" + item.ID + "</td><td>" + item.DOC_TYPE + "</td><td>" + item.FILENAME + "</td><td><a href='/Candidate/Delete/" + item.ID + "' class='lnkDelete'>Delete</a></td></tr>";
                    });
                    $("#tbldoc").html(row);

                    $("#DOCUMENT_TYPE_ID").val('');
                    $("#DOCUMENT_PATH").val('');
                },
                error: function (ex) {

                }
            });
            return false;
        });
    });

</script>

@*Delete Doc*@
<script type="text/javascript">
    $(document).ready(function () {
        $("#tbldoc").on("click", ".lnkDelete", function (e) {
            var href = $(this).context.href;
            var docid = href.substr(href.indexOf("/") + 35)

            var answer = confirm("Are you sure you want to delete this record?");
            if (answer) {

                $.ajax({
                    type: 'POST',
                    url: '@Url.Action("DeleteDocDetails")', // we are calling json method
                    dataType: 'json',
                    data: { docid: docid },
                    success: function (data) {
                        data = $.parseJSON(data);
                        var row = "";
                        row += "<tr><th>ID</th><th>Document Type</th><th>Document</th><th></th></tr>"
                        $.each(data, function (index, item) {
                            row += "<tr><td>" + item.ID + "</td><td>" + item.DOC_TYPE + "</td><td>" + item.FILENAME + "</td><td><a href='/Candidate/Delete/" + item.ID + "' class='lnkDelete'>Delete</a></td></tr>";
                        });
                        $("#tbldoc").html(row);

                        $("#DOCUMENT_TYPE_ID").val('');
                        $("#DOCUMENT_PATH").val('');
                    },
                    error: function (ex) {
                    }
                });
                return false;
            }
            else {
                return false;
            }
        });
    });
</script>


@*Number event*@
<script type="text/javascript">
    function isNumberKey(evt) {

        var charCode = (evt.which) ? evt.which : event.keyCode

        if (charCode > 31 && (charCode < 48 || charCode > 57))

            return false;

        return true;

    }
</script>

@*Date picker*@
<script type="text/javascript">
    $(document).ready(function () {
        $('#DATE_OF_BIRTH').datepicker({
            format: "dd/mm/yyyy",
            endDate: '-1d',
            autoclose: true
        });

        $('#DATE_OF_ISSUE').datepicker({
            format: "dd/mm/yyyy",
            autoclose: true
        });
        5
        $('#EXPIRY_DATE').datepicker({
            format: "dd/mm/yyyy",
            autoclose: true
        });

        $('#DRIVING_DATE_OF_ISSUE').datepicker({
            format: "dd/mm/yyyy",
            autoclose: true
        });

        $('#DRIVING_EXPIRY_DATE').datepicker({
            format: "dd/mm/yyyy",
            autoclose: true
        });

        $('.input-daterange').datepicker({
            todayBtn: "linked",
            format: "dd/mm/yyyy",
            autoclose: true
        });
    });
</script>

@*Smart Wizard*@
<script type="text/javascript">
    $(document).ready(function () {
        $('#wizard').smartWizard({
            //onLeaveStep: leaveAStepCallback,
            //onFinish: onFinishCallback
        });

        function leaveAStepCallback(obj, context) {
            //alert("Leaving step " + context.fromStep + " to go to step " + context.toStep);
            return validateTab(context.fromStep); // return false to stay on step and true to continue navigation
        }

        function onFinishCallback(objs, context) {
            //if(validateAllSteps()){

            $('#formControl').submit();
            //}
        }
    });
</script>

@*State Binding with Country Code*@
<script type="text/javascript">
    $(document).ready(function () {
        //Dropdownlist Selectedchange event
        $("#COUNTRY_CODE").change(function () {
            $("#STATE_CODE").empty();
            $.ajax({
                type: 'POST',
                url: '@Url.Action("GetStateByCountryCode")', // we are calling json method
                dataType: 'json',
                data: { Country_code: $("#COUNTRY_CODE").val() },
                success: function (states) {
                    $("#STATE_CODE").append('<option value="0">--Select State--</option>');
                    // states contains the JSON formatted list
                    // of states passed from the controller
                    $.each(states, function (i, state) {
                        $("#STATE_CODE").append('<option value="' + state.Value + '">' + state.Text + '</option>');
                    }); // here we are adding option for States
                },
                error: function (ex) {
                    $("#STATE_CODE").append('<option value="0">--Select State--</option>');
                }
            });
            return false;
        })
    });
</script>

@*City Binding with State Code*@
<script type="text/javascript">
    $(document).ready(function () {
        //Dropdownlist Selectedchange event
        $("#STATE_CODE").change(function () {
            $("#CITY_CODE").empty();
            $.ajax({
                type: 'POST',
                url: '@Url.Action("GetCityByStateCode")', // we are calling json method
                dataType: 'json',
                data: { State_code: $("#STATE_CODE").val() },
                success: function (states) {
                    $("#CITY_CODE").append('<option value="0">--Select City--</option>');
                    // states contains the JSON formatted list
                    // of states passed from the controller
                    $.each(states, function (i, state) {
                        $("#CITY_CODE").append('<option value="' + state.Value + '">' + state.Text + '</option>');
                    }); // here we are adding option for States
                },
                error: function (ex) {
                    $("#CITY_CODE").append('<option value="0">--Select City--</option>');
                }
            });
            return false;
        })
    });
</script>

@*State Binding with Country Code*@
<script type="text/javascript">
    $(document).ready(function () {
        //Dropdownlist Selectedchange event
        $("#WORK_EXP_COUNTRY_CODE").change(function () {
            $("#WORK_EXP_STATE_CODE").empty();
            $.ajax({
                type: 'POST',
                url: '@Url.Action("GetStateByCountryCode")', // we are calling json method
                dataType: 'json',
                data: { Country_code: $("#WORK_EXP_COUNTRY_CODE").val() },
                success: function (states) {
                    $("#WORK_EXP_STATE_CODE").append('<option value="0">--Select State--</option>');
                    // states contains the JSON formatted list
                    // of states passed from the controller
                    $.each(states, function (i, state) {
                        $("#WORK_EXP_STATE_CODE").append('<option value="' + state.Value + '">' + state.Text + '</option>');
                    }); // here we are adding option for States
                },
                error: function (ex) {
                    $("#WORK_EXP_STATE_CODE").append('<option value="0">--Select State--</option>');
                }
            });
            return false;
        })
    });
</script>

@*City Binding with State Code*@
<script type="text/javascript">
    $(document).ready(function () {
        //Dropdownlist Selectedchange event
        $("#WORK_EXP_STATE_CODE").change(function () {
            $("#WORK_EXP_CITY_CODE").empty();
            $.ajax({
                type: 'POST',
                url: '@Url.Action("GetCityByStateCode")', // we are calling json method
                dataType: 'json',
                data: { State_code: $("#WORK_EXP_STATE_CODE").val() },
                success: function (states) {
                    $("#WORK_EXP_CITY_CODE").append('<option value="0">--Select City--</option>');
                    // states contains the JSON formatted list
                    // of states passed from the controller
                    $.each(states, function (i, state) {
                        $("#WORK_EXP_CITY_CODE").append('<option value="' + state.Value + '">' + state.Text + '</option>');
                    }); // here we are adding option for States
                },
                error: function (ex) {
                    $("#WORK_EXP_CITY_CODE").append('<option value="0">--Select City--</option>');
                }
            });
            return false;
        })
    });
</script>

@*Save Address*@
<script type="text/javascript">
    $(document).ready(function () {

        $("#SaveAddress").click(function (e) {
            var ADDRESS_TYPE_ID = $("#ADDRESS_TYPE_ID").val();
            var ADDRESS = $("#ADDRESS").val();
            var COUNTRY_CODE = $("#COUNTRY_CODE").val();
            var STATE_CODE = $("#STATE_CODE").val();
            var CITY_CODE = $("#CITY_CODE").val();
            var VILLAGE = $("#VILLAGE").val();
            var PIN_CODE = $("#PIN_CODE").val();

            if (ADDRESS_TYPE_ID == "") {
                alert("Please select Address Type");
                $("#ADDRESS_TYPE_ID").focus();
                return false;
            }
            if (ADDRESS == "") {
                alert("Please enter Address");
                $("#ADDRESS").focus();
                return false;
            }

            if (COUNTRY_CODE == "") {
                alert("Please select Country");
                $("#COUNTRY_CODE").focus();
                return false;
            }

            if (STATE_CODE == "") {
                alert("Please select State");
                $("#STATE_CODE").focus();
                return false;
            }
            if (CITY_CODE == "") {
                alert("Please select City");
                $("#CITY_CODE").focus();
                return false;
            }

            if (PIN_CODE == "") {
                alert("Please enter Pincode");
                $("#PIN_CODE").focus();
                return false;
            }

            $.ajax({
                type: 'POST',
                url: '@Url.Action("SaveAddressDetails")', // we are calling json method
                dataType: 'json',
                data: { address_type: $("#ADDRESS_TYPE_ID").val(), address: $("#ADDRESS").val(), citycode: $("#CITY_CODE").val(), pincode: $("#PIN_CODE").val(), village: $("#VILLAGE").val(), regno: $("#REGISTRATION_NO").val() },
                success: function (data) {
                    data = $.parseJSON(data);
                    var row = "";
                    row += "<tr><th>ID</th><th>Address</th><th>Country</th><th>StateCity</th><th>Village</th><th>Pincode</th><th></th></tr>"
                    $.each(data, function (index, item) {
                        row += "<tr><td>" + item.ID + "</td><td>" + item.Address + "</td><td>" + item.Country + "</td><td>" + item.StateCity + "</td><td>" + item.Village + "</td><td>" + item.Pin_Code + "</td> <td><a href='/Candidate/Delete/" + item.ID + "' class='lnkDelete'>Delete</a></td></tr>";
                    });
                    $("#tblchild").html(row);

                    $("#PIN_CODE").val('');
                    $("#VILLAGE").val('');
                    $("#ADDRESS").val('');
                    $("#ADDRESS_TYPE_ID").val('0');
                    $("#Country_Code").val('0');
                    $("#State_Code").val('0');
                    $("#City_Code").val('0');
                },
                error: function (ex) {

                }
            });
            return false;
        });
    });
</script>

@*Delete Addess*@
<script type="text/javascript">
    $(document).ready(function () {
        $("#tblchild").on("click", ".lnkDelete", function (e) {
            var href = $(this).context.href;
            var addressid = href.substr(href.indexOf("/") + 35)

            var answer = confirm("Are you sure you want to delete this record?");
            if (answer) {

                $.ajax({
                    type: 'POST',
                    url: '@Url.Action("DeleteAddressDetails")', // we are calling json method
                    dataType: 'json',
                    data: { addressid: addressid },
                    success: function (data) {
                        data = $.parseJSON(data);
                        var row = "";
                        row += "<tr><th>ID</th><th>Address</th><th>Country</th><th>StateCity</th><th>Village</th><th>Pincode</th><th></th></tr>"
                        $.each(data, function (index, item) {
                            row += "<tr><td>" + item.ID + "</td><td>" + item.Address + "</td><td>" + item.Country + "</td><td>" + item.StateCity + "</td><td>" + item.Village + "</td><td>" + item.Pin_Code + "</td> <td><a href='/Candidate/Delete/" + item.ID + "' class='lnkDelete'>Delete</a></td></tr>";
                        });
                        $("#tblchild").html(row);

                        $("#PIN_CODE").val('');
                        $("#VILLAGE").val('');
                        $("#ADDRESS").val('');
                        $("#ADDRESS_TYPE_ID").val('0');
                        $("#Country_Code").val('0');
                        $("#State_Code").val('0');
                        $("#City_Code").val('0');
                    },
                    error: function (ex) {
                    }
                });
                return false;
            }
            else {
                return false;
            }
        });
    });
</script>

@*Save Email*@
<script type="text/javascript">
    $(document).ready(function () {

        $("#SaveEmail").click(function (e) {
            var EMAIL_ID = $("#EMAIL_ID").val();

            if (EMAIL_ID == "") {
                alert("Please enter Email_ID");
                $("#EMAIL_ID").focus();
                return false;
            }

            $.ajax({
                type: 'POST',
                url: '@Url.Action("SaveEmailDetails")', // we are calling json method
                dataType: 'json',
                data: { EmailId: $("#EMAIL_ID").val() },
                success: function (data) {
                    data = $.parseJSON(data);
                    var row = "";
                    row += "<tr><th>ID</th><th>Email_ID</th><th></th></tr>"
                    $.each(data, function (index, item) {
                        row += "<tr><td>" + item.ID + "</td><td>" + item.EMAIL_ID + "</td><td><a href='/Candidate/Delete/" + item.ID + "' class='lnkDelete'>Delete</a></td></tr>";
                    });
                    $("#tblemail").html(row);

                    $("#EMAIL_ID").val('');
                },
                error: function (ex) {

                }
            });
            return false;
        });
    });
</script>

@*Delete Email*@
<script type="text/javascript">
    $(document).ready(function () {
        $("#tblemail").on("click", ".lnkDelete", function (e) {
            var href = $(this).context.href;
            var emailid = href.substr(href.indexOf("/") + 35)

            var answer = confirm("Are you sure you want to delete this record?");
            if (answer) {

                $.ajax({
                    type: 'POST',
                    url: '@Url.Action("DeleteEmailDetails")', // we are calling json method
                    dataType: 'json',
                    data: { emailid: emailid },
                    success: function (data) {
                        data = $.parseJSON(data);
                        var row = "";
                        row += "<tr><th>ID</th><th>Email_ID</th><th></th></tr>"
                        $.each(data, function (index, item) {
                            row += "<tr><td>" + item.ID + "</td><td>" + item.EMAIL_ID + "</td><td><a href='/Candidate/Delete/" + item.ID + "' class='lnkDelete'>Delete</a></td></tr>";
                        });
                        $("#tblemail").html(row);

                        $("#EMAIL_ID").val('');
                    },
                    error: function (ex) {
                    }
                });
                return false;
            }
            else {
                return false;
            }
        });
    });
</script>

@*Save Phone*@
<script type="text/javascript">
    $(document).ready(function () {

        $("#SavePhone").click(function (e) {
            var PHONE_TYPE_ID = $("#PHONE_TYPE_ID").val();
            var PHONE_NO = $("#PHONE_NO").val();

            if (PHONE_TYPE_ID == "") {
                alert("Please select Phone Type");
                $("#PHONE_TYPE_ID").focus();
                return false;
            }

            if (PHONE_NO == "") {
                alert("Please enter Phone No");
                $("#PHONE_NO").focus();
                return false;
            }

            $.ajax({
                type: 'POST',
                url: '@Url.Action("SavePhoneDetails")', // we are calling json method
                dataType: 'json',
                data: { PHONE_NO: PHONE_NO, PHONE_TYPE_ID: PHONE_TYPE_ID },
                success: function (data) {
                    data = $.parseJSON(data);
                    var row = "";
                    row += "<tr><th>ID</th><th>PhoneNo</th><th></th></tr>"
                    $.each(data, function (index, item) {
                        row += "<tr><td>" + item.ID + "</td><td>" + item.PHONE_NO + "</td><td><a href='/Candidate/Delete/" + item.ID + "' class='lnkDelete'>Delete</a></td></tr>";
                    });
                    $("#tblphone").html(row);

                    $("#PHONE_NO").val('');
                },
                error: function (ex) {

                }
            });
            return false;
        });
    });
</script>

@*Delete Phone*@
<script type="text/javascript">
    $(document).ready(function () {
        $("#tblphone").on("click", ".lnkDelete", function (e) {
            var href = $(this).context.href;
            var phoneid = href.substr(href.indexOf("/") + 35)

            var answer = confirm("Are you sure you want to delete this record?");
            if (answer) {

                $.ajax({
                    type: 'POST',
                    url: '@Url.Action("DeletePhoneDetails")', // we are calling json method
                    dataType: 'json',
                    data: { phoneid: phoneid },
                    success: function (data) {
                        data = $.parseJSON(data);
                        var row = "";
                        row += "<tr><th>ID</th><th>PhoneNo</th><th></th></tr>"
                        $.each(data, function (index, item) {
                            row += "<tr><td>" + item.ID + "</td><td>" + item.PHONE_NO + "</td><td><a href='/Candidate/Delete/" + item.ID + "' class='lnkDelete'>Delete</a></td></tr>";
                        });
                        $("#tblphone").html(row);

                        $("#PHONE_NO").val('');
                    },
                    error: function (ex) {
                    }
                });
                return false;
            }
            else {
                return false;
            }
        });
    });
</script>

@*Save Certification*@
<script type="text/javascript">
    $(document).ready(function () {

        $("#SaveCertification").click(function (e) {
            var CERTIFICATION = $("#CERTIFICATION").val();
            var CERTIFICATION_LEVEL = $("#CERTIFICATION_LEVEL").val();
            var INSTITUTE_NAME = $("#INSTITUTE_NAME").val();
            var INSTITUE_YEAR_OF_PASSING = $("#INSTITUE_YEAR_OF_PASSIN").val();

            if (CERTIFICATION == "") {
                alert("Please enter Certification");
                $("#CERTIFICATION").focus();
                return false;
            }

            if (CERTIFICATION_LEVEL == "") {
                alert("Please enter Ceritification Level");
                $("#CERTIFICATION_LEVEL").focus();
                return false;
            }
            if (INSTITUTE_NAME == "") {
                alert("Please enter Institute Name");
                $("#INSTITUTE_NAME").focus();
                return false;
            }

            if (INSTITUE_YEAR_OF_PASSING == "") {
                alert("Please enter Year of Passing");
                $("#INSTITUE_YEAR_OF_PASSIN").focus();
                return false;
            }

            $.ajax({
                type: 'POST',
                url: '@Url.Action("SaveCertificationDetails")', // we are calling json method
                dataType: 'json',
                data: { CERTIFICATION: CERTIFICATION, CERTIFICATION_LEVEL: CERTIFICATION_LEVEL, INSTITUTE_NAME: INSTITUTE_NAME, INSTITUE_YEAR_OF_PASSING: INSTITUE_YEAR_OF_PASSING },
                success: function (data) {
                    data = $.parseJSON(data);
                    var row = "";
                    row += "<tr><th>ID</th><th>Certification</th><th>Certification Level</th><th>Institute</th><th>Year of Passing</th><th></th></tr>"
                    $.each(data, function (index, item) {
                        row += "<tr><td>" + item.ID + "</td><td>" + item.CERTIFICATION + "</td><td>" + item.CERTIFICATION_LEVEL + "</td><td>" + item.INSTITUTE_NAME + "</td><td>" + item.INSTITUE_YEAR_OF_PASSING + "</td><td><a href='/Candidate/Delete/" + item.ID + "' class='lnkDelete'>Delete</a></td></tr>";
                    });
                    $("#tblcertification").html(row);

                    $("#CERTIFICATION").val('');
                    $("#CERTIFICATION_LEVEL").val('');
                    $("#INSTITUTE_NAME").val('');
                    $("#INSTITUE_YEAR_OF_PASSIN").val('');

                },
                error: function (ex) {

                }
            });
            return false;
        });
    });
</script>

@*Delete Certification*@
<script type="text/javascript">
    $(document).ready(function () {
        $("#tblcertification").on("click", ".lnkDelete", function (e) {
            var href = $(this).context.href;
            var certificationid = href.substr(href.indexOf("/") + 35)

            var answer = confirm("Are you sure you want to delete this record?");
            if (answer) {

                $.ajax({
                    type: 'POST',
                    url: '@Url.Action("DeleteCertificationDetails")', // we are calling json method
                    dataType: 'json',
                    data: { certificationid: certificationid },
                    success: function (data) {
                        data = $.parseJSON(data);
                        var row = "";
                        row += "<tr><th>ID</th><th>Certification</th><th>Certification Level</th><th>Institute</th><th>Year of Passing</th><th></th></tr>"
                        $.each(data, function (index, item) {
                            row += "<tr><td>" + item.ID + "</td><td>" + item.CERTIFICATION + "</td><td>" + item.CERTIFICATION_LEVEL + "</td><td>" + item.INSTITUTE_NAME + "</td><td>" + item.INSTITUE_YEAR_OF_PASSING + "</td><td><a href='/Candidate/Delete/" + item.ID + "' class='lnkDelete'>Delete</a></td></tr>";
                        });
                        $("#tblcertification").html(row);

                        $("#CERTIFICATION").val('');
                        $("#CERTIFICATION_LEVEL").val('');
                        $("#INSTITUTE_NAME").val('');
                        $("#INSTITUE_YEAR_OF_PASSIN").val('');
                    },
                    error: function (ex) {
                    }
                });
                return false;
            }
            else {
                return false;
            }
        });
    });
</script>

@*Save Education*@
<script type="text/javascript">
    $(document).ready(function () {

        $("#SaveEducation").click(function (e) {
            var EDUCATION_TYPE_ID = $("#EDUCATION_TYPE_ID").val();
            var SPECIALIZATION_TYPE_ID = $("#SPECIALIZATION_TYPE_ID").val();
            var UNIVERSITY_ID = $("#UNIVERSITY_ID").val();
            var UNIVERSITY_YEAR_OF_PASSING = $("#UNIVERSITY_YEAR_OF_PASSING").val();

            if (EDUCATION_TYPE_ID == "") {
                alert("Please select Education Type");
                $("#EDUCATION_TYPE_ID").focus();
                return false;
            }

            if (SPECIALIZATION_TYPE_ID == "") {
                alert("Please select Specialization Type");
                $("#SPECIALIZATION_TYPE_ID").focus();
                return false;
            }
            if (UNIVERSITY_ID == "") {
                alert("Please select University");
                $("#UNIVERSITY_ID").focus();
                return false;
            }

            if (UNIVERSITY_YEAR_OF_PASSING == "") {
                alert("Please enter Year of Passing");
                $("#UNIVERSITY_YEAR_OF_PASSING").focus();
                return false;
            }

            $.ajax({
                type: 'POST',
                url: '@Url.Action("SaveEducationDetails")', // we are calling json method
                dataType: 'json',
                data: { EDUCATION_TYPE_ID: EDUCATION_TYPE_ID, SPECIALIZATION_TYPE_ID: SPECIALIZATION_TYPE_ID, UNIVERSITY_ID: UNIVERSITY_ID, UNIVERSITY_YEAR_OF_PASSING: UNIVERSITY_YEAR_OF_PASSING },
                success: function (data) {
                    data = $.parseJSON(data);
                    var row = "";
                    row += "<tr><th>ID</th><th>Education</th><th>Specialization</th><th>University</th><th>Year of Passing</th><th></th></tr>"
                    $.each(data, function (index, item) {
                        row += "<tr><td>" + item.ID + "</td><td>" + item.EDUCATION_TYPE + "</td><td>" + item.SPECIALIZATION_TYPE + "</td><td>" + item.UNIVERSITY + "</td><td>" + item.UNIVERSITY_YEAR_OF_PASSING + "</td><td><a href='/Candidate/Delete/" + item.ID + "' class='lnkDelete'>Delete</a></td></tr>";
                    });
                    $("#tbleducation").html(row);

                    $("#EDUCATION_TYPE_ID").val('');
                    $("#SPECIALIZATION_TYPE_ID").val('');
                    $("#UNIVERSITY_ID").val('');
                    $("#UNIVERSITY_YEAR_OF_PASSING").val('');

                },
                error: function (ex) {

                }
            });
            return false;
        });
    });
</script>

@*Delete Certification*@
<script type="text/javascript">
    $(document).ready(function () {
        $("#tbleducation").on("click", ".lnkDelete", function (e) {
            var href = $(this).context.href;
            var educationid = href.substr(href.indexOf("/") + 35)

            var answer = confirm("Are you sure you want to delete this record?");
            if (answer) {

                $.ajax({
                    type: 'POST',
                    url: '@Url.Action("DeleteEducationDetails")', // we are calling json method
                    dataType: 'json',
                    data: { educationid: educationid },
                    success: function (data) {
                        data = $.parseJSON(data);
                        var row = "";
                        row += "<tr><th>ID</th><th>Education</th><th>Specialization</th><th>University</th><th>Year of Passing</th><th></th></tr>"
                        $.each(data, function (index, item) {
                            row += "<tr><td>" + item.ID + "</td><td>" + item.EDUCATION_TYPE + "</td><td>" + item.SPECIALIZATION_TYPE + "</td><td>" + item.UNIVERSITY + "</td><td>" + item.UNIVERSITY_YEAR_OF_PASSING + "</td><td><a href='/Candidate/Delete/" + item.ID + "' class='lnkDelete'>Delete</a></td></tr>";
                        });
                        $("#tbleducation").html(row);

                        $("#EDUCATION_TYPE_ID").val('');
                        $("#SPECIALIZATION_TYPE_ID").val('');
                        $("#UNIVERSITY_ID").val('');
                        $("#UNIVERSITY_YEAR_OF_PASSING").val('');
                    },
                    error: function (ex) {
                    }
                });
                return false;
            }
            else {
                return false;
            }
        });
    });
</script>

@*Save Work*@
<script type="text/javascript">
    $(document).ready(function () {

        $("#SaveWork").click(function (e) {
            var USER_COMPANY_NAME = $("#USER_COMPANY_NAME").val();
            var DESIGNATION_ID = $("#DESIGNATION_ID").val();
            var INDUSTRY_ID = $("#INDUSTRY_ID").val();
            var WORK_PERIOD_FROM = $("#WORK_PERIOD_FROM").val();
            var WORK_PERIOD_TO = $("#WORK_PERIOD_TO").val();
            var WORK_EXP_CITY_CODE = $("#WORK_EXP_CITY_CODE").val();

            var IS_EXPERIENCED = $('input[name=careerstatus]:checked').val();
            var IS_CURRENT_STATUS = $('input[name=currentlyworking]:checked').val();

            if (IS_EXPERIENCED == "experience") {
                if (USER_COMPANY_NAME == "") {
                    alert("Please select Company");
                    $("#USER_COMPANY_NAME").focus();
                    return false;
                }

                if (DESIGNATION_ID == "") {
                    alert("Please select Designation");
                    $("#DESIGNATION_ID").focus();
                    return false;
                }

                if (INDUSTRY_ID == "") {
                    alert("Please select Industry");
                    $("#INDUSTRY_ID").focus();
                    return false;
                }

                if (WORK_PERIOD_FROM == "") {
                    alert("Please enter Work Period From");
                    $("#WORK_PERIOD_FROM").focus();
                    return false;
                }

                if (WORK_PERIOD_TO == "") {
                    alert("Please enter Work Period To");
                    $("#WORK_PERIOD_TO").focus();
                    return false;
                }
            }
            $.ajax({
                type: 'POST',
                url: '@Url.Action("SaveWorkDetails")', // we are calling json method
                dataType: 'json',
                data: { IS_EXPERIENCED: IS_EXPERIENCED, IS_CURRENT_STATUS: IS_CURRENT_STATUS, USER_COMPANY_NAME: USER_COMPANY_NAME, DESIGNATION_ID: DESIGNATION_ID, INDUSTRY_ID: INDUSTRY_ID, WORK_PERIOD_FROM: WORK_PERIOD_FROM, WORK_PERIOD_TO: WORK_PERIOD_TO, WORK_EXP_CITY_CODE: WORK_EXP_CITY_CODE },
                success: function (data) {
                    data = $.parseJSON(data);
                    var row = "";
                    row += "<tr><th>ID</th><th>Company</th><th>Designation</th><th>Industry</th><th>Work Period</th><th>Career Status</th><th>Currently Working</th><th></th></tr>"
                    $.each(data, function (index, item) {
                        row += "<tr><td>" + item.ID + "</td><td>" + item.COMPANY + "</td><td>" + item.DESIGNATION + "</td><td>" + item.INDUSTRY + "</td><td>" + item.WORK_PERIOD + "</td><td>" + item.IS_EXPERIENCED + "</td><td>" + item.IS_CURRENT_STATUS + "</td><td><a href='/Candidate/Delete/" + item.ID + "' class='lnkDelete'>Delete</a></td></tr>";
                    });
                    $("#tblwork").html(row);

                    $("#USER_COMPANY_NAME").val('');
                    $("#DESIGNATION_ID").val('');
                    $("#INDUSTRY_ID").val('');
                    $("#WORK_PERIOD_FROM").val('');
                    $("#WORK_PERIOD_TO").val('');
                    $("#WORK_EXP_CITY_CODE").val('');
                    $("#WORK_EXP_STATE_CODE").val('');
                    $("#WORK_EXP_COUNTRY_CODE").val('');
                },
                error: function (ex) {

                }
            });
            return false;
        });
    });
</script>

@*Delete Work*@
<script type="text/javascript">
    $(document).ready(function () {
        $("#tblwork").on("click", ".lnkDelete", function (e) {
            var href = $(this).context.href;
            var workid = href.substr(href.indexOf("/") + 35)

            var answer = confirm("Are you sure you want to delete this record?");
            if (answer) {

                $.ajax({
                    type: 'POST',
                    url: '@Url.Action("DeleteWorkDetails")', // we are calling json method
                    dataType: 'json',
                    data: { workid: workid },
                    success: function (data) {
                        data = $.parseJSON(data);
                        var row = "";
                        row += "<tr><th>ID</th><th>Company</th><th>Designation</th><th>Industry</th><th>Work Period</th><th>Current Status</th><th></th></tr>"
                        $.each(data, function (index, item) {
                            row += "<tr><td>" + item.ID + "</td><td>" + item.USER_COMPANY_NAME + "</td><td>" + item.DESIGNATION + "</td><td>" + item.INDUSTRY + "</td><td>" + item.WORK_PERIOD_FORM + " - " + item.WORK_PERIOD_TO + "</td><td>" + item.CURRENT_STATUS + "</td><td><a href='/Candidate/Delete/" + item.ID + "' class='lnkDelete'>Delete</a></td></tr>";
                        });
                        $("#tblwork").html(row);

                        $("#USER_COMPANY_NAME").val('');
                        $("#DESIGNATION_ID").val('');
                        $("#INDUSTRY_ID").val('');
                        $("#WORK_PERIOD_FROM").val('');
                        $("#WORK_PERIOD_TO").val('');
                        $("#WORK_EXP_CITY_CODE").val('');
                        $("#WORK_EXP_STATE_CODE").val('');
                        $("#WORK_EXP_COUNTRY_CODE").val('');
                    },
                    error: function (ex) {
                    }
                });
                return false;
            }
            else {
                return false;
            }
        });
    });
</script>

@*Save Language*@
<script type="text/javascript">
    $(document).ready(function () {

        $("#SaveLanguage").click(function (e) {
            debugger;
            var LANGUAGE_ID = $("#LANGUAGE_ID").val();

            var IS_READ = $('#IS_READ').prop('checked');
            var IS_WRITE = $('#IS_WRITE').prop('checked');
            var IS_SPEAK = $("#IS_SPEAK").prop('checked');

            if (LANGUAGE_ID == "") {
                alert("Please select Language");
                $("#LANGUAGE_ID").focus();
                return false;
            }

            $.ajax({
                type: 'POST',
                url: '@Url.Action("SaveLanguageDetails")', // we are calling json method
                dataType: 'json',
                data: { LANGUAGE_ID: LANGUAGE_ID, IS_READ: IS_READ, IS_WRITE: IS_WRITE, IS_SPEAK: IS_SPEAK },
                success: function (data) {
                    data = $.parseJSON(data);
                    var row = "";
                    row += "<tr><th>ID</th><th>Language</th><th>Read</th><th>Write</th><th>Speak</th><th></th></tr>"
                    $.each(data, function (index, item) {
                        row += "<tr><td>" + item.ID + "</td><td>" + item.LANGUAGE + "</td><td>" + item.IS_READ + "</td><td>" + item.IS_WRITE + "</td><td>" + item.IS_SPEAK + "</td><td><a href='/Candidate/Delete/" + item.ID + "' class='lnkDelete'>Delete</a></td></tr>";
                    });
                    $("#tbllanguage").html(row);

                    $("#LANGUAGE_ID").val('');
                    $("#IS_READ").prop('checked', false);
                    $("#IS_WRITE").prop('checked', false);
                    $("#IS_SPEAK").prop('checked', false);
                },
                error: function (ex) {

                }
            });
            return false;
        });
    });
</script>

@*Delete Language*@
<script type="text/javascript">
    $(document).ready(function () {
        $("#tbllanguage").on("click", ".lnkDelete", function (e) {
            var href = $(this).context.href;
            var languageid = href.substr(href.indexOf("/") + 35)

            var answer = confirm("Are you sure you want to delete this record?");
            if (answer) {

                $.ajax({
                    type: 'POST',
                    url: '@Url.Action("DeleteLanguageDetails")', // we are calling json method
                    dataType: 'json',
                    data: { languageid: languageid },
                    success: function (data) {
                        data = $.parseJSON(data);
                        var row = "";
                        row += "<tr><th>ID</th><th>Language</th><th>Read</th><th>Write</th><th>Speak</th><th></th></tr>"
                        $.each(data, function (index, item) {
                            row += "<tr><td>" + item.ID + "</td><td>" + item.LANGUAGE + "</td><td>" + item.IS_READ + "</td><td>" + item.IS_WRITE + "</td><td>" + item.IS_SPEAK + "</td><td><a href='/Candidate/Delete/" + item.ID + "' class='lnkDelete'>Delete</a></td></tr>";
                        });
                        $("#tbllanguage").html(row);

                        $("#LANGUAGE_ID").val('');
                    },
                    error: function (ex) {
                    }
                });
                return false;
            }
            else {
                return false;
            }
        });
    });
</script>


